<%@ Page Language="C#" EnableViewState="false" ValidateRequest="false" AutoEventWireup="true" 
	 MasterPageFile="~/App_ThemeMasters/NoStyle/OneColumnLayout.Master" Inherits="Syrinx.Gui.AspNet.Ajax.NitobiBasePage" %>
<%@ Register Assembly="Swaf.Gui.AspNet2" Namespace="Swaf.Gui.AspNet2" TagPrefix="swf" %>
<%@ Register Assembly="ScsAspNet" Namespace="Syrinx.Gui.AspNet.Ajax" TagPrefix="saj" %><%@ Register Assembly="NitobiControls" Namespace="Nitobi" TagPrefix="ntb" %>
<%@ Register Assembly="ScsAspNet" Namespace="Articles.Gui.AspNet" TagPrefix="art" %>

<!--#include file="~/SiteControls/RegisterStandardControls.txt"-->
<!--#include file="../SiteControls/StandardHeaderPageContent.inc"-->
<!--#include file="../SiteControls/StandardFooterPageContent.inc"-->

<script runat="server">
	public string TitleFormat = "$glgo.title$ - $glgo.summary$ - Online Help";
</script>

<asp:Content ID="c1" ContentPlaceHolderID="title" runat="server">
	<%SecurityPrivilege = "AppFunctions.ManageArticles"; %>
    <swf:BizProc ID="help" runat="server" FactoryName="genericArticles">
		<State pid="OnlineHelp" entireTree="true" includeSelf="true" EditModeSessionKey="GlobalEdit" listDetailLevel="idAndTitle" />
		<ParentBizProc id="loginBP" />
    </swf:BizProc>
</asp:Content>

<asp:Content ID="c2" ContentPlaceHolderID="trails" runat="server">
<script>
function DivResizer(div,resizer){
	this.resizer = resizer;
	this.div=div;
	this.box=document.getElementById("ebagridresizebox_");
	if(this.box==null){
	this.box=document.createElement("div");
	this.box.id="ebagridresizebox_";
	document.body.appendChild(this.box);
	this.box.className="ntbcolumnresizeline";
	}
}

DivResizer.prototype.startResize=function(evt){
//debugger;
var _2cb=null;
var x,y;
var _2ce=nitobi.html.getEventCoords(evt);
x=evt.offsetX;//_2ce.x;
y=evt.offsetY;//_2ce.y;
this.x=_2ce.x;//x;
this.y=_2ce.y;
var w=this.div.style.pixelWidth;
var h=this.div.style.pixelHeight;
var L=0;//this.div.offsetLeft;
var T=0;//this.div.offsetTop;
this.resizeW=(Math.abs((x-L)-w)<3)||((Math.abs((y-T)-h)<16)&&(Math.abs((x-L)-w)<16));
this.resizeH=(Math.abs((y-T)-h)<3)||((Math.abs((y-T)-h)<16)&&(Math.abs((x-L)-w)<16));
if(this.resizeW||this.resizeH){
this.box.style.cursor=(this.resizeW&&this.resizeH)?"NW-Resize":(this.resizeW)?"W-Resize":"N-Resize";
this.box.style.visibility="visible";
this.box.style.width=(x-L)+"px";
this.box.style.height=(y-T)+"px";
var _2d3=nitobi.drawing.align.SAMEWIDTH|nitobi.drawing.align.SAMEHEIGHT|nitobi.drawing.align.ALIGNTOP|nitobi.drawing.align.ALIGNLEFT;
nitobi.drawing.align(this.box,this.div,_2d3,0,0,0,0,false);
this.dd=new nitobi.ui.DragDrop(this.box,false,false);
this.dd.onDragStop.subscribe(this.endResize,this);
this.dd.onMouseMove.subscribe(this.resize,this);
this.dd.startDrag(evt);
}
};

DivResizer.prototype.resize=function(){
//debugger;
var x=this.dd.x;
var y=this.dd.y;
var L=this.div.offsetLeft;
var T=this.div.offsetTop;
this.box.style.visibility="visible";
if(this.resizeW){
this.div.innerHtml = "x = " + x + " : this.x = " + this.x + " : box.pixelWidth = " + this.box.style.pixelWidth;
this.box.style.width= this.div.style.pixelWidth + (x-this.x)+"px";
}
if(this.resizeH){
this.box.style.height=this.div.style.pixelHeight + (y-this.y)+"px";
}
};

DivResizer.prototype.endResize=function(){
var x=this.dd.x;
var y=this.dd.y;
this.box.style.visibility="hidden";
var _2da=this.div.style.pixelWidth;
var _2db=this.div.style.pixelHeight;
var _2dc=parseInt(_2da)+((this.resizeW)?x-this.x:0);
var _2dd=parseInt(_2db)+((this.resizeH)?y-this.y:0);
if(isNaN(_2dc)||isNaN(_2dd)){
return;
}
if(_2dc>20&&_2dd>20){
debugger;
this.div.style.width = _2dc + "px";
this.div.style.height = _2dd + "px";
var base = document.getElementById("ctl00_d0_mainContent_ad1_d2_baseBody_toolbarArea").parentElement;
var tbHeight = base.children[0].offsetHeight;
var tabHeight = base.children[4].offsetHeight
//this.resizer.style.height = (_2dd - tbHeight - tabHeight - 20) + "px";//this.resizer.offsetHeight + (y - this.y) + "px";
this.resizer.style.height = this.resizer.offsetHeight + (y - this.y) + "px";
}
};

DivResizer.prototype.dispose=function(){
this.grid=null;
};
function setupSizer()
{
sr = new DivResizer(document.getElementById("sizeArea"),document.getElementById("ctl00_d0_mainContent_ad1_d2_baseBody_designEditor"))
}
var sr = null;
function start(item)
{
if(sr == null)
	setupSizer();
sr.startResize(window.event);
}
</script>
	<table width="95%" cellpadding="0" cellspacing="0"><tr>
	<td>
        <span class="button6"><saj:ActionButton runat="server" ID="updateBtn1" Actions="help.UpdateBizObj" Text="Update" /></span>
	    <span class="button1"><saj:ActionButton runat="server" ID="addBtn" Actions="help.AddBizObj" Text="Add" /></span>
	    <span class="button2"><saj:ActionButton runat="server" ID="cancelBtn" Actions="help.CancelEdits" Text="Cancel" /></span>
	    <span class="button5"><saj:ActionButton runat="server" ID="deleteBtn" Actions="help.DeleteBizObj" Text="Delete" ClientClick="if(!confirm('Are you sure you want to delete?'))return false;"/></span>
		<span class="button1"><saj:ActionButton runat="server" ID="translationBtn" Actions="help.SwitchTranslation" Text="Translate" SessionBoolSwitch="TranslationMode" /></span>
	    <span class="button1"><saj:ActionButton runat="server" ID="setPicBtn" Actions="help.SetArticlePicture" Text="Set Image" 
		    PopupPage="../popups/SetArticleImagePopup.aspx" PopupHeight="550px" PopupWidth="800px" PopupTitle="Select a primary image for this article." /></span>
	    <span class="button4"><saj:ActionButton runat="server" ID="editMode" Actions="help.SwitchEdit" Text="Edit" SessionBoolSwitch="GlobalEdit" /></span>
	 </td></tr></table>
</asp:Content>

<asp:Content ID="c3" ContentPlaceHolderID="mainContent" runat="server">
	<table ><tr><td>
    <div class="verticalbg"> 
	    <saj:Grid ID="articleList1Display" runat="server" Width="320px" Height="600px"  
		    ShowToolbar="false" ParentBizProcIds="help" Mode="LiveScrolling">
		    <Columns>
			    <ntb:KeyColumn DataField="id" visible="false" />
			    <ntb:BoundColumn DataField="depthName" HeaderText="Name" width="300" />
		    </Columns>
	    </saj:Grid>
    </div>
</td><td>
    <div class="horizontalbg">
        <div>
	        <art:ArticleTranslationDisplay runat="server" ID="ad1"
		        ParentBizProcIds="help" 
		        TranslationTemplate="Articles.Gui.AspNet.ArticleTranslationRWDisplay"
		        ReadOnlyTemplate="Articles.Gui.AspNet.ArticleRODisplay"
		        EditableTemplate="Articles.Gui.AspNet.ArticleRWDisplay" >
	        </art:ArticleTranslationDisplay>
        </div>
        <div>
	        <span class="button6"><saj:ActionButton runat="server" ID="ActionButton1" Actions="help.UpdateBizObj" Text="Update" /></span>
        </div>
    </div>	    
</td></tr></table>    
</asp:Content>
